<template>
	<view class="content">
		<view class="" :style="'height: '+statusBarHeight+'px;'"></view>
		<view class="bletop">
			钱包
		</view>
		<view class="news flex-between" @click="$fun.jump(`/pages/index/notifications?type=0&name=公告`)">
			<view class="news_left">
				<image src="../../static/wallet/news.png" mode=""></image>
				<view class="news_line"></view>
				<view class="">关于提现系统升级问题</view>
			</view>
			<image src="../../static/wallet/goin.png" mode=""></image>
		</view>
		<view class="about flex-between">
			<view class="" @click="$fun.jump('/pages/wallet/twtpath?type=1&title=充值')">
				<image src="../../static/wallet/recharge.png" mode=""></image>
				<view class="">充值</view>
			</view>
			<view class="" @click="$fun.jump('/pages/wallet/twtpath?type=2&title=提现')">
				<image src="../../static/wallet/withdraw.png" mode=""></image>
				<view class="">提现</view>
			</view>
			<view class="" @click="$fun.jump('/pages/wallet/twtpath?type=3&title=转账')">
				<image src="../../static/wallet/transfer.png" mode=""></image>
				<view class="">转账</view>
			</view>
			<view class="" @click="$fun.jump('/pages/wallet/donation')">
				<image src="../../static/wallet/Receivegift.png" mode=""></image>
				<view class="">收赠</view>
			</view>
		</view>
		<view class="wallet flex-between" @click="$fun.jump(`/pages/wallet/wallet`)">
			<view class="">
				<view class="wallet_name">今日收益</view>
				<view class="wallet_num">6,547.00</view>
			</view>
			<view class="">
				<view class="wallet_name">设备钱包</view>
				<view class="wallet_num">6,547.00</view>
			</view>
			<image src="../../static/wallet/goin.png" mode=""></image>
		</view>
		<view class="sellist flex-between">
			<view class="sellist_list flex-between" v-for="(item,index) in sellist" :key="index">
				<view class="sellist_center flex-between" style="align-items: normal;"
					@click="$fun.jump(`${item.path}`)">
					<image :src="item.img" mode=""></image>
					<view class="">
						<view class="sellist_center_name">{{item.name}}</view>
						<view class="sellist_center_number">{{item.num}}</view>
					</view>
				</view>
				<image src="../../static/wallet/goin.png" mode=""></image>
			</view>
		</view>
		<view class="node">
			<view class="flex">
				<view class="node_center">
					<view class="node_names">全球累计算力</view>
					<view class="node_numdata">6,547.00</view>
				</view>
				<view class="">
					<view class="node_names">个人算力</view>
					<view class="node_numdata">6,547.00</view>
				</view>
			</view>
			<view class="flex" style="margin-top: 30rpx;">
				<view class="node_center">
					<view class="node_names">今日全网算力</view>
					<view class="node_numdata">6,547.00</view>
				</view>
				<view class="">
					<view class="node_names">全域当前算力</view>
					<view class="node_numdata">6,547.00</view>
				</view>
			</view>
		</view>
		<view class="" style="padding-bottom: 150rpx;">
			<view class="myproperty">我的资产</view>
			<view class="flex-between property">
				<view class="">名称</view>
				<view class="">数量</view>
			</view>
			<view class="propertylist flex-between" v-for="(item,index) in 3" :key="index"
				@click="$fun.jump(`./indexdetail`)">
				<view class="flex" style="align-items: center;">
					<image src="../../static/sel.png" mode=""></image>
					<view class="">TOPS</view>
				</view>
				<view class="">1,000.00</view>
			</view>
		</view>
		<appUpdate v-if="appUpdateShow" :update_info="update_info" @closeModel="closeModel"></appUpdate>
	</view>
</template>

<script>
	import appUpdate from "@/components/yzhua006-update/app-update.vue";
	import {
		checkUpdate
	} from "@/components/yzhua006-update/js/app-update-check.js";
	export default {
		components: {
			appUpdate,
		},
		data() {
			return {
				title: 'Hello',
				appUpdateShow: false,
				statusBarHeight: 0,
				update_info: {},
				sellist: [{
						img: "../../static/wallet/pledge.png",
						name: '质押',
						num: '6,547.00',
						path: '/pages/wallet/pledge'
					},
					{
						img: "../../static/wallet/Bonuspool.png",
						name: '分红池',
						num: '6,547.00',
						path: '/pages/index/pool?title=分红池'
					},
					{
						img: "../../static/wallet/Nodepool.png",
						name: '节点池',
						num: '6,547.00',
						path: '/pages/index/pool?title=节点池'
					}
				]
			}
		},
		onLoad() {
			// #ifdef APP-PLUS
			// this.getAppInfo()
			// #endif
		},
		onShow() {
			const phoneInfo = uni.getSystemInfoSync(); // 获取手机系统信息
			this.statusBarHeight = phoneInfo.statusBarHeight
		},
		methods: {
			getAppInfo(type) {
				const that = this
				const system_info = uni.getSystemInfoSync();
				let params = {
					os: system_info.platform //本机设备操作系统  （android || ios） 
				}
				if (params.os != 'ios' && params.os != 'android') false; //如果不是安卓或ios 返回false

				//这里自行请求API获取版本信息 建议传入操作系统标识，返回本机对应的操作系统最新版本信息，也就是安卓的返回就是安卓的版本信息  ios返回就是ios的版本信息

				//请求获取最新版本
				plus.runtime.getProperty(plus.runtime.appid, (result) => {
					that.$fun.ajax.post('config/version', {
						version: result.version
					}).then(res => {
						that.update_info = {
							version: res.data.version, //线上版本
							now_url: res.data.pkgUrl, //更新链接
							silent: res.data.silent, //是否是静默更新
							force: res.data.force, //是否是强制更新
							net_check: res.data.net_check, //非WIfi是否提示
							note: res.data.content, //更新内容
						}
						checkUpdate(that.update_info, type, that).then(res => {
							if (res.data) {
								that.appUpdateShow = true
							} else {
								// this.$fun.msg(res.msg)
							}
						}); ///检查更新  
						//checkUpdate 这个方法会做什么？：线上版本号 与 本地版本号做对比 ，如果需要更新  根据静默，强制、wifi等信息执行静默更新或跳转到升级页面
						//跳转升级页面的前提是，需要新建并在pages.json中配置升级页面，配置方法请查看插件详情
					})
				})

			},
			closeModel() {
				this.appUpdateShow = false
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {
		width: 100%;
		height: 100%;
		background-image: url('../../static/wallet/bg@2x.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}

	.bletop {
		width: 750rpx;
		height: 88rpx;
		line-height: 88rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 600;
		font-size: 36rpx;
		color: #333333;
		text-align: center;
		font-style: normal;
		text-align: center;
	}

	.news {
		width: 690rpx;
		height: 80rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		align-items: center;
		padding-left: 20rpx;
		box-sizing: border-box;
		margin: 20rpx auto 30rpx;

		&_left {
			display: flex;
			align-items: center;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #333333;
			line-height: 24rpx;
			text-align: center;
			font-style: normal;

			image {
				width: 48rpx;
				height: 40rpx;
			}

			.img1 {
				width: 2rpx;
				height: 24rpx;
			}
		}

		&_line {
			width: 2rpx;
			height: 24rpx;
			background: #999999;
			border-radius: 4rpx;
			margin: 28rpx 20rpx 28rpx 13rpx;
		}

		image {
			width: 48rpx;
			height: 48rpx;
		}
	}

	.about {
		width: 690rpx;
		height: 166rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
		text-align: center;
		font-style: normal;
		margin: 0 auto;
		padding: 0 50rpx;
		box-sizing: border-box;
		align-items: center;

		image {
			width: 72rpx;
			height: 72rpx;
		}
	}

	.wallet {
		width: 690rpx;
		height: 150rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		background-image: url('../../static/wallet/bg3@2x.png');
		background-size: 182rpx 131rpx;
		background-repeat: no-repeat;
		margin: 30rpx auto;
		padding: 30rpx 0 30rpx 30rpx;
		box-sizing: border-box;
		font-family: PingFangSC, PingFang SC;
		font-style: normal;

		&_name {
			font-weight: 500;
			font-size: 28rpx;
			color: #999999;
			text-align: left;
		}

		&_num {
			font-weight: 500;
			font-size: 44rpx;
			color: #333333;
		}

		image {
			width: 48rpx;
			height: 48rpx;
		}
	}

	.sellist {
		margin: 0 30rpx;

		image {
			width: 48rpx;
			height: 48rpx;
		}

		&_list {
			width: 210rpx;
			height: 98rpx;
			background: #FFFFFF;
			border-radius: 24rpx;
			padding: 20rpx 0 20rpx 10rpx;
			box-sizing: border-box;
		}

		&_center {
			image {
				width: 24rpx;
				height: 22rpx;
				margin-right: 10rpx;
				margin-top: 10rpx;
			}

			&_name {
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 24rpx;
				color: #999999;
			}

			&_number {
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 24rpx;
				color: #333333;
			}
		}
	}

	.node {
		width: 690rpx;
		height: 206rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		margin: 20rpx auto 60rpx;
		padding: 30rpx;
		box-sizing: border-box;

		&_center {
			width: 50%;
		}

		&_names {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 24rpx;
			color: #999999;
			line-height: 24rpx;
		}

		&_numdata {
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #333333;
			line-height: 24rpx;
			margin-top: 10rpx;
		}
	}

	.myproperty {
		font-family: PingFangSC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
		line-height: 32rpx;
		text-align: left;
		font-style: normal;
		margin-left: 30rpx;
	}

	.property {
		font-family: PingFangSC, PingFang SC;
		font-weight: 500;
		font-size: 24rpx;
		color: #999999;
		margin: 30rpx 30rpx 10rpx;
	}

	.propertylist {
		image {
			width: 72rpx;
			height: 72rpx;
			margin-right: 20rpx;
			border-radius: 50%;
		}

		font-family: PingFangSC,
		PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #333333;
		width: 750rpx;
		height: 100rpx;
		align-items: center;
		padding: 0 30rpx 0 32rpx;
		box-sizing: border-box;
	}
</style>